package com.bh.fee.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bh.common.utils.DateUtils;
import com.bh.common.utils.SecurityUtils;
import com.bh.fee.domain.JcFeeSeed;
import com.bh.fee.mapper.JcFeeSeedMapper;
import com.bh.fee.service.IJcFeeSeedService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Arrays;
import java.util.List;

/**
 * 费用传递Service业务层处理
 * 
 * @author slx
 * @date 2023-05-21
 */
@Service
public class JcFeeSeedServiceImpl extends ServiceImpl<JcFeeSeedMapper, JcFeeSeed> implements IJcFeeSeedService
{
    @Autowired
    private JcFeeSeedMapper jcFeeSeedMapper;

    /**
     * 查询费用传递
     * 
     * @param id 费用传递主键
     * @return 费用传递
     */
    @Override
    public JcFeeSeed selectJcFeeSeedById(Long id)
    {
        return jcFeeSeedMapper.selectById(id);
    }

    /**
     * 查询费用传递列表
     * 
     * @param jcFeeSeed 费用传递
     * @return 费用传递
     */
    @Override
    public List<JcFeeSeed> selectJcFeeSeedList(JcFeeSeed jcFeeSeed)
    {
        return jcFeeSeedMapper.selectJcFeeSeedList(jcFeeSeed);
    }

    /**
     * 新增费用传递
     * 
     * @param jcFeeSeed 费用传递
     * @return 结果
     */
    @Override
    public int insertJcFeeSeed(JcFeeSeed jcFeeSeed)
    {
        jcFeeSeed.setCreateTime(DateUtils.getNowDate());
        jcFeeSeed.setCreateName(SecurityUtils.getUsername());
        return jcFeeSeedMapper.insert(jcFeeSeed);
    }

    /**
     * 修改费用传递
     * 
     * @param jcFeeSeed 费用传递
     * @return 结果
     */
    @Override
    public int updateJcFeeSeed(JcFeeSeed jcFeeSeed)
    {
        return jcFeeSeedMapper.updateById(jcFeeSeed);
    }

    /**
     * 批量删除费用传递
     * 
     * @param ids 需要删除的费用传递主键
     * @return 结果
     */
    @Override
    public int deleteJcFeeSeedByIds(Long[] ids)
    {
        return jcFeeSeedMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除费用传递信息
     * 
     * @param id 费用传递主键
     * @return 结果
     */
    @Override
    public int deleteJcFeeSeedById(Long id)
    {
        return jcFeeSeedMapper.deleteById(id);
    }
}
